import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from '../node_modules/axios'
import qs from 'qs';
// import'../node_modules/echarts/map/js/province/zhejiang.js';
import VueWechatShare from 'vue-wechat-share'

Vue.use(VueWechatShare, {
  appId: 'wx77dec9047c8c94d9'
})
// 引入echarts
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
import dataV from '@jiaminghi/data-view'
Vue.use(dataV)
import scroll from 'vue-seamless-scroll'
Vue.use(scroll)
import jquery from "jquery";
Vue.prototype.$ = jquery;
import './util/rem'

import Vant from 'vant'
import 'vant/lib/index.css'

Vue.use(Vant)


import md5 from 'js-md5';
Vue.prototype.$md5 = md5;


// import './assets/js/rem'

import VueLoadmore from 'vuejs-loadmore';
Vue.use(VueLoadmore);

import VueClipboard from 'vue-clipboard2'
VueClipboard.config.autoSetContainer = true
Vue.use(VueClipboard)

import wx from 'weixin-js-sdk'
Vue.use(wx)

// import echarts from 'echarts'
// Vue.prototype.$echarts = echarts
// Vue.prototype.$qs = qs

Vue.prototype.$axios = axios;
Vue.use(ElementUI);
Vue.filter('formatDate', function (originVal) {
  const dt = new Date(originVal)
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')
 
  const hh = (dt.getHours() + '').padStart(2, '0')
  const mm = (dt.getMinutes() + '').padStart(2, '0')
  const ss = (dt.getSeconds() + '').padStart(2, '0')
  // yyyy-mm-dd hh:mm:ss
  return `${y}-${m}-${d}`
})

Vue.filter('formatDate2', function (originVal) {
  const dt = new Date(originVal)
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')
 
  const hh = (dt.getHours() + '').padStart(2, '0')
  const mm = (dt.getMinutes() + '').padStart(2, '0')
  const ss = (dt.getSeconds() + '').padStart(2, '0')
  // yyyy-mm-dd hh:mm:ss
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
router.afterEach((to, from, next) => {
  window.scrollTo(0, 0)

});

Vue.config.productionTip = false

new Vue({
  router,
  store,
  axios,
  render: h => h(App)
}).$mount('#app')
